<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?><!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Login :: Robi CMS Admin Panel</title>

    <!-- Bootstrap framework -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/backend/bootstrap/css/bootstrap.min.css" />
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/backend/bootstrap/css/bootstrap-responsive.min.css" />
        <style type="text/css">
            body { max-width: none!important; }
            body, html { height: auto!important; }
        </style>

    <!-- theme color-->
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/backend/styles/blue.css" />
    <!-- tooltip -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/backend/lib/qtip2/jquery.qtip.min.css" />
    <!-- main styles -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/backend/styles/style.css" />

    <!-- Favicons and the like (avoid using transparent .png) -->
        <link rel="shortcut icon" href="<?php echo base_url(); ?>assets/backend/favicon.ico" />

    <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>

    <!--[if lte IE 8]>
        <script type="text/javascript" src="<?php echo base_url(); ?>assets/backend/scripts/ie/html5.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>assets/backend/scripts/ie/respond.min.js"></script>
    <![endif]-->

</head>

<body class="login_page">


    <!-- header -->
    <header style="margin-bottom: 150px;"><div class="navbar navbar-fixed-top"><div class="navbar-inner"><div class="container-fluid">

        <a class="brand" href="<?php echo base_url(); ?>"><i class="icon-home icon-white"></i> Robi CMS</a>

    </div></div></div></header><!--header ends-->


    <div class="login_box">

        <?php echo form_open('login/do_login', array('id' => 'login_form')); ?>
            <div class="top_b">Sign in to Robi CMS Admin</div>

            <?php if (isset($message_error) && $message_error != '') : ?>
            <div class="alert alert-error alert-login">
                <?php echo $message_error; ?>
            </div>
            <?php endif; ?>

            <div class="cnt_b">
                <div class="formRow">
                    <div class="input-prepend">
                        <span class="add-on"><i class="icon-user"></i></span><input type="text" id="user_login_id" name="user_login_id" placeholder="Username" />
                    </div>
                </div>
                <div class="formRow">
                    <div class="input-prepend">
                        <span class="add-on"><i class="icon-lock"></i></span><input type="password" id="user_password" name="user_password" placeholder="Password" />
                    </div>
                </div>
            </div>
            <div class="btm_b clearfix">
                <button class="btn btn-inverse pull-right" type="submit">Sign In</button>
            </div>
        </form>

        <?php /*echo form_open('login/generate_new_password', array('id' => 'pass_form', 'style' => 'display:none')); */?><!--
            <div class="top_b">Can't sign in?</div>
            <div class="alert alert-info alert-login">
                Please enter your email address. You will receive a link to create a new password via email.
            </div>
            <div class="cnt_b">
                <div class="formRow clearfix">
                    <div class="input-prepend">
                        <span class="add-on">@</span><input type="text" placeholder="Your email address" />
                    </div>
                </div>
            </div>
            <div class="btm_b tac">
                <button class="btn btn-inverse" type="submit">Request New Password</button>
            </div>
        </form>-->

    </div>

    <div class="links_b links_btm clearfix">
        <!--<span class="linkform"><a href="#pass_form">Forgot password?</a></span>-->
        <span class="linkform" style="display:none">Never mind, <a href="#login_form">send me back to the sign-in screen</a></span>
    </div>

    <script type="text/javascript" src="<?php echo base_url(); ?>assets/backend/scripts/jquery.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>assets/backend/scripts/jquery.actual.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>assets/backend/lib/validation/jquery.validate.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>assets/backend/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){

            if ($('#user_login_id').val() == '') {
                $('#user_login_id').focus();
            } else {
                $('#user_password').focus();
            }

            //* boxes animation
            form_wrapper = $('.login_box');
            $('.linkform a, .link_reg a').on('click',function(e){
                var target	= $(this).attr('href'),
                    target_height = $(target).actual('height');
                $(form_wrapper).css({
                    'height'		: form_wrapper.height()
                });
                $(form_wrapper.find('form:visible')).fadeOut(400,function(){
                    form_wrapper.stop().animate({
                        height	: target_height
                    },500,function(){
                        $(target).fadeIn(400);
                        $('.links_btm .linkform').toggle();
                        $(form_wrapper).css({
                            'height'		: ''
                        });
                    });
                });
                e.preventDefault();
            });

            //* validation
            $('#login_form').validate({
                onkeyup: false,
                errorClass: 'error',
                validClass: 'valid',
                rules: {
                    user_login_id: { required: true },
                    user_password: { required: true }
                },
                highlight: function(element) {
                    $(element).closest('div').addClass("f_error");
                },
                unhighlight: function(element) {
                    $(element).closest('div').removeClass("f_error");
                },
                errorPlacement: function(error, element) {
                    $(element).closest('div').append(error);
                }
            });
        });
    </script>

<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>

</body>
</html>